791af539e304b7468882ad4021c8343f20d20239,1.8.8/src/main/java/net/geforcemods/securitycraft/blocks/BlockKeypad.java,BlockKeypad,getActualState,#IBlockState#IBlockAccess#BlockPos#,167
Before Change
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
if(!(world.getTileEntity(pos) instanceof TileEntityKeypad)) return state;
return state.withProperty(DISGUISED, ((TileEntityKeypad) world.getTileEntity(pos)).hasModule(EnumCustomModules.DISGUISE));
}
protected BlockState createBlockState()
After Change
if(world.getTileEntity(pos) instanceof TileEntityKeypad) {
TileEntityKeypad te = (TileEntityKeypad) world.getTileEntity(pos);
ItemStack stack = te.hasModule(EnumCustomModules.DISGUISE) ? te.getModule(EnumCustomModules.DISGUISE) : null;
if(stack != null && !((ItemModule) stack.getItem()).getBlockAddons(stack.getTagCompound()).isEmpty()) {
Block block = ((ItemModule) stack.getItem()).getBlockAddons(stack.getTagCompound()).get(0);